/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author ccedeno
 */
@Entity
@Table(name = "estado", catalog = "emilima_tradoc", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Estado.findAll", query = "SELECT e FROM Estado e"),
    @NamedQuery(name = "Estado.findByIdEstado", query = "SELECT e FROM Estado e WHERE e.idEstado = :idEstado"),
    @NamedQuery(name = "Estado.findByNombre", query = "SELECT e FROM Estado e WHERE e.nombre = :nombre")})
public class Estado implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "id_estado", nullable = false, length = 2)
    private String idEstado;
    @Size(max = 45)
    @Column(name = "nombre", length = 45)
    private String nombre;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<InteresArea> interesAreaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<EstadoDoc> estadoDocList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<Usuario> usuarioList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<Trabajador> trabajadorList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<TipoTramite> tipoTramiteList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<Expediente> expedienteList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<TipoPriorida> tipoPrioridaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<CargoRespon> cargoResponList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<MovExp> movExpList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<Interesado> interesadoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<TipoDocInterno> tipoDocInternoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<TipoDocTra> tipoDocTraList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<AccDoc> accDocList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<Area> areaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<CorrDocArea> corrDocAreaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<DocAdjunto> docAdjuntoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<MovEncarga> movEncargaList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estado", fetch = FetchType.LAZY)
    private List<TipoUsuario> tipoUsuarioList;

    public Estado() {
    }

    public Estado(String idEstado) {
        this.idEstado = idEstado;
    }

    public String getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(String idEstado) {
        this.idEstado = idEstado;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    @XmlTransient
    public List<InteresArea> getInteresAreaList() {
        return interesAreaList;
    }

    public void setInteresAreaList(List<InteresArea> interesAreaList) {
        this.interesAreaList = interesAreaList;
    }

    @XmlTransient
    public List<EstadoDoc> getEstadoDocList() {
        return estadoDocList;
    }

    public void setEstadoDocList(List<EstadoDoc> estadoDocList) {
        this.estadoDocList = estadoDocList;
    }

    @XmlTransient
    public List<Usuario> getUsuarioList() {
        return usuarioList;
    }

    public void setUsuarioList(List<Usuario> usuarioList) {
        this.usuarioList = usuarioList;
    }

    @XmlTransient
    public List<Trabajador> getTrabajadorList() {
        return trabajadorList;
    }

    public void setTrabajadorList(List<Trabajador> trabajadorList) {
        this.trabajadorList = trabajadorList;
    }

    @XmlTransient
    public List<TipoTramite> getTipoTramiteList() {
        return tipoTramiteList;
    }

    public void setTipoTramiteList(List<TipoTramite> tipoTramiteList) {
        this.tipoTramiteList = tipoTramiteList;
    }

    @XmlTransient
    public List<Expediente> getExpedienteList() {
        return expedienteList;
    }

    public void setExpedienteList(List<Expediente> expedienteList) {
        this.expedienteList = expedienteList;
    }

    @XmlTransient
    public List<TipoPriorida> getTipoPrioridaList() {
        return tipoPrioridaList;
    }

    public void setTipoPrioridaList(List<TipoPriorida> tipoPrioridaList) {
        this.tipoPrioridaList = tipoPrioridaList;
    }

    @XmlTransient
    public List<CargoRespon> getCargoResponList() {
        return cargoResponList;
    }

    public void setCargoResponList(List<CargoRespon> cargoResponList) {
        this.cargoResponList = cargoResponList;
    }

    @XmlTransient
    public List<MovExp> getMovExpList() {
        return movExpList;
    }

    public void setMovExpList(List<MovExp> movExpList) {
        this.movExpList = movExpList;
    }

    @XmlTransient
    public List<Interesado> getInteresadoList() {
        return interesadoList;
    }

    public void setInteresadoList(List<Interesado> interesadoList) {
        this.interesadoList = interesadoList;
    }

    @XmlTransient
    public List<TipoDocInterno> getTipoDocInternoList() {
        return tipoDocInternoList;
    }

    public void setTipoDocInternoList(List<TipoDocInterno> tipoDocInternoList) {
        this.tipoDocInternoList = tipoDocInternoList;
    }

    @XmlTransient
    public List<TipoDocTra> getTipoDocTraList() {
        return tipoDocTraList;
    }

    public void setTipoDocTraList(List<TipoDocTra> tipoDocTraList) {
        this.tipoDocTraList = tipoDocTraList;
    }

    @XmlTransient
    public List<AccDoc> getAccDocList() {
        return accDocList;
    }

    public void setAccDocList(List<AccDoc> accDocList) {
        this.accDocList = accDocList;
    }

    @XmlTransient
    public List<Area> getAreaList() {
        return areaList;
    }

    public void setAreaList(List<Area> areaList) {
        this.areaList = areaList;
    }

    @XmlTransient
    public List<CorrDocArea> getCorrDocAreaList() {
        return corrDocAreaList;
    }

    public void setCorrDocAreaList(List<CorrDocArea> corrDocAreaList) {
        this.corrDocAreaList = corrDocAreaList;
    }

    @XmlTransient
    public List<DocAdjunto> getDocAdjuntoList() {
        return docAdjuntoList;
    }

    public void setDocAdjuntoList(List<DocAdjunto> docAdjuntoList) {
        this.docAdjuntoList = docAdjuntoList;
    }

    @XmlTransient
    public List<MovEncarga> getMovEncargaList() {
        return movEncargaList;
    }

    public void setMovEncargaList(List<MovEncarga> movEncargaList) {
        this.movEncargaList = movEncargaList;
    }

    @XmlTransient
    public List<TipoUsuario> getTipoUsuarioList() {
        return tipoUsuarioList;
    }

    public void setTipoUsuarioList(List<TipoUsuario> tipoUsuarioList) {
        this.tipoUsuarioList = tipoUsuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEstado != null ? idEstado.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Estado)) {
            return false;
        }
        Estado other = (Estado) object;
        if ((this.idEstado == null && other.idEstado != null) || (this.idEstado != null && !this.idEstado.equals(other.idEstado))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return idEstado ;
    }
}
